package me.sealer.ssm.controller.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 功能描述： $ RegisterRequest
 *
 * @author sealer
 * @email 1178884049@qq.com
 * @date 2019年12月26日 10时59分01秒
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "注册请求参数")
public class RegisterRequest {
    @NotBlank(message = "用户名不能为空")
    @ApiModelProperty(value = "用户名", required = true)
    private String username;

    @NotBlank(message = "密码不能为空")
    @ApiModelProperty(value = "密码", required = true)

    private String password;

    @NotBlank(message = "确认密码不能为空")
    @ApiModelProperty(value = "确认密码", required = true)
    private String confirmPassword;

    @NotBlank(message = "性别不能为空")
    @ApiModelProperty(value = "性别", required = true, allowableValues = "0,1,2", example = "2")
    private String sex;

    @NotBlank(message = "地址不能为空")
    @ApiModelProperty(value = "地址", required = true)
    private String address;

    @NotNull(message = "出生日期不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "出生日期", required = true, example = "2019-12-31")
    private Date birthday;
}
